using UnityEngine;
using UnityEngine.UI;

namespace MaterialUI
{
	[AddComponentMenu("MaterialUI/Dialogs/Date Picker Item", 100)]
	public class DialogDatePickerYearItem : DialogClickableOption
	{
		[SerializeField]
		private Text m_Text;

		[SerializeField]
		private Toggle m_Toggle;

		[SerializeField]
		private VectorImage m_SelectedImage;

		private int m_Year;

		public Text text => m_Text;

		public Toggle toggle => m_Toggle;

		public VectorImage selectedImage => m_SelectedImage;

		public int year
		{
			get
			{
				return m_Year;
			}
			set
			{
				m_Year = value;
				text.text = m_Year.ToString();
			}
		}

		public void UpdateState(int currentYear)
		{
			if (year == currentYear)
			{
				toggle.isOn = true;
			}
		}

		public void OnItemValueChange()
		{
			m_Text.color = ((!toggle.isOn) ? Color.black : Color.white);
		}
	}
}
